improvement(slack): request the approved mention/assistant/DM scopes, advertised on v2 only#5898
Conversation
… advertised on v2 only Slack app review has since approved `app_mentions:read`, `assistant:write`, and `im:history` — they are live in the prod app manifest's `oauth_config.scopes.bot` — but the repo still had them commented out behind a stale "re-add once approved" TODO. Sim was therefore requesting a narrower grant than the app is entitled to, so newly connected accounts got tokens missing exactly the scopes backing three `simSubscribed` events on the native Sim app trigger: `app_mention` (app_mentions:read), assistant threads (assistant:write), and DMs (im:history). The requested scope set now matches the manifest's 20 approved bot scopes exactly. Scopes are per-credential, not per-block (one Slack app -> one `slack` provider -> one shared token, requested server-side via getCanonicalScopesForProvider), so the grant itself cannot be scoped to v2. What is per-block is what each picker advertises and treats as missing, so: - slack_v2 + the slack_oauth trigger advertise the full set (they host the native Sim app trigger that needs it). - The legacy v1 block stays pinned to the pre-expansion 17 scopes. It has no feature needing the new three, and advertising them there would flag every existing Slack credential as missing scopes and prompt a needless reconnect. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018asmKsWQ5Vi7T7wD9uHofz
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Block UI scope advertising is split: the legacy Reviewed by Cursor Bugbot for commit 98fa2ee. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR expands the canonical Slack OAuth grant while preserving narrower scope-completeness checks for legacy blocks.
Confidence Score: 5/5The PR appears safe to merge, with the OAuth grant and version-specific scope advertisements consistently wired to their intended consumers. The canonical provider list supplies all three new scopes to authorization, Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
Provider[Canonical Slack scopes: 20] --> OAuth[OAuth authorization request]
Provider --> V2[slack_v2 picker: 20 required]
Provider --> Trigger[slack_oauth trigger: 20 required]
Provider --> Filter[Remove mention, assistant, and DM scopes]
Filter --> V1[Legacy Slack picker: 17 required]
OAuth --> Token[Connected Slack credential]
Reviews (1): Last reviewed commit: "improvement(slack): request the approved..." | Re-trigger Greptile |
What
Slack app review has since approved
app_mentions:read,assistant:write, andim:history— they're live in the prod app manifest underoauth_config.scopes.bot— but the repo still had them commented out behind a stale "TODO: Re-add once Slack app review approves these".So Sim was requesting a narrower grant than the app is entitled to. Newly connected accounts got tokens missing exactly the scopes that back three
simSubscribedevents on the native Sim app trigger (#5892):app_mentionapp_mentions:readassistant_thread_started/_context_changedassistant:writemessage.im(DMs)im:historyThe requested set now matches the manifest's 20 approved bot scopes exactly (verified at runtime).
Why v1 keeps the narrow list
Scopes are per-credential, not per-block — one Slack app → one
slackprovider → one shared token, requested server-side viagetCanonicalScopesForProvider('slack')(lib/auth/auth.ts:2805). The grant itself can't be scoped to v2.What is per-block is what each picker advertises and treats as missing. So:
slack_v2+ theslack_oauthtrigger advertise the full 20 — they host the native Sim app trigger that needs them.A reconnect still grants the full set regardless of which block started it — this only controls the nag and the displayed permission list. Verified that the integrations/connections surface keys
isConnectedoff a directproviderIdmatch, not scope completeness, so existing Slack connections are not marked incomplete.Not included
The Home tab (
app_home_opened) is still custom-bot-only and correctly gated. It is absent from the manifest'sevent_subscriptions.bot_events, so Slack does not deliver it to the shared app. Flipping itssimSubscribedflag would make deploys pass while the trigger silently never fires. Enabling it is a manifest change first (addapp_home_openedtobot_events; no new scope required), then a one-line catalog flip.Checks
bunx vitest run lib/webhooks triggers/slack blocks tools/slack— 886 passed (79 files)bun run type-check— no new errors (5 pre-existing better-auth errors unchanged)bun run lint:check— cleancheck-block-registry.ts— pass🤖 Generated with Claude Code
https://claude.ai/code/session_018asmKsWQ5Vi7T7wD9uHofz